﻿using System.IO;

namespace SlamCms.Common
{
	public static class StreamExtensions
	{
		public static void CopyTo(this Stream origin, Stream destination, int bufferSize = 4096)
		{
			int num;
			byte[] buffer = new byte[bufferSize];
			while ((num = origin.Read(buffer, 0, buffer.Length)) != 0)
			{
				destination.Write(buffer, 0, num);
			}
		}
	}
}
